<include file="../Public/header.html" />
<link href="__PUBLIC__/Css/user.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/Js/user/common.js" charset="UTF-8"></script>
<script>
    //鼠标移动表格效果
    $(document).ready(function(){
    	inittable();
    });
    
    function inittable(){
        $("#record_item_list").find('tr').hover(
          function () {
            $(this).addClass("bg_hover");
          },
          function () {
            $(this).removeClass("bg_hover");
          }
        );
    }
    function goPage(pno){
 		$.kajax({      
			url:"{:U('User://Account/ajxCash')}",      
			type:'post', //数据发送方式  
			data:{pno:pno,atype:$('#ajx_show_area_detail').find('#atype').val()} ,    
			async: false ,//同步方式     
			success: function(html){ 
				$('#ajx_show_area_detail').html(html);
			}
		});
 	}
    
    function ajxGetDetail(stype){
    	k_changeGroupStyle('right_box',' #top_nav > ul > li',stype,'top_baron');
    	if(stype=='charge'){
    		$.kajax({      
    			url:"{:U('User://Account/charge')}",      
    			type:'post', //数据发送方式  
    			//data:{pno:pno,atype:$('#ajx_show_area_detail').find('#atype').val()} ,    
    			async: false ,//同步方式     
    			success: function(html){ 
    				$('#ajx_show_area_detail').html(html);
    			}
    		});
    	}else{
	    	$('#ajx_show_area_detail').find('#atype').val(stype);
	    	goPage(1);
    	}
    }
    
    function refreshCash(){
    	$.kajax({      
    		ajx_rtn_type:'JSON',//HTML JSON jsonData
			url:"{:U('User://Account/ajxRefreshCash')}",      
			type:'post', //数据发送方式  
			//data:{pno:pno,atype:$('#ajx_show_area_detail').find('#atype').val()} ,    
			async: false ,//同步方式     
			success: function(jsonData){ 
				//alert(jsonData);
				k_success("账户余额刷新完成！账户余额："+jsonData.data.current_money_format);
				$('#cash_total_amount').html(jsonData.data.current_money_format);
			}
		});
    }
</script>

<div id="mainWrapper">

	<div id="main">
	 	<include file="../User/Tpl/default/Public/user_left_nav_box.html" />
	    
	    <div id="right_box">
			<div class="item_top" id='top_nav'>
				<span style="float:right;font-weight:bold">
					账户余额：&nbsp;
					<font style="color:red;font-size:16px;font-style: italic;" id="cash_total_amount">{:formatMoney($totalamount)}</font>
					&nbsp;
					&nbsp;&nbsp;
					<a href="javascript:refreshCash()" style="color:#666666;font-size:12px;">刷新</a>
					&nbsp;
					&nbsp;&nbsp;
				</span>
				<ul>
					<li class="top_bar top-bar-wide top_baron" rel='in' onclick="ajxGetDetail('in');">充值记录</li>
				</ul>
				<ul>
					<li class="top_bar top-bar-wide" rel='out' onclick="ajxGetDetail('out');">支出记录</li>
				</ul>
				<ul>
					<li class="top_bar top-bar-wide" rel='charge' onclick="ajxGetDetail('charge');">账户冲值</li>
				</ul>
			</div>
			
			<div style="margin-top:5px" id='ajx_show_area_detail'>
			<php>if($_REQUEST['atype']!='charge'){</php>
				<include file="../User/Tpl/default/Account/cash_list_box.html" />
			<php>}else{</php>
				<script>k_changeGroupStyle('right_box',' #top_nav > ul > li','charge','top_baron');</script>
				<include file="../User/Tpl/default/Account/charge.html" />
			<php>}</php>
			</div>
		</div>
	  	<!-- 右侧内容 end  -->
	  	<div class="c"></div>
	</div>
</div>

<include file="../Public/footer.html" />